package testshijuan;

import java.util.Arrays;
import java.util.Scanner;

public class Test3 {
    public static void main(String[] args) {
         /*(10分)3：
        输入一个正整数，获得他去掉最高位后的数，比如输入123，
        则结果是23；输入1000结果是0，输入25结果是5，输入9结果是0.*/
        Scanner scan = new Scanner(System.in);//99
        System.out.println("请输入一个整数：");//1000-->1
        //1010--》0101
        int num = scan.nextInt();
        boolean isFalg = true;
        int account = 0;
        int jieXian = 10;
        while (isFalg) {
            if (num >= jieXian) {
                jieXian *= 10;
                account++;
            } else {
                //System.out.println(num +"为"+ (account + 1)+"位整数");
                isFalg = false;
            }
        }
        //int dnum =0;
        int[] arr3 = new int[account + 1];
        int n = 0;
        for (int i = 0; i < arr3.length; i++) {
            while (num > 0) {
                int a = num % 10;
                //dnum = 10 * dnum + a;
                num /= 10;
                arr3[n] = a;
                n++;
                System.out.println(a);

            }
        }
        System.out.println(Arrays.toString(arr3));//x000  x 0  \25000 00052 5000 \123 321 23\ 1001 1001 1
        if (num % 10 == 0 ||num<10) {
            while (num > 1) {
                num /= 10;
            }
            System.out.println("去掉最高位结果为:" + 0);
        } else {
            for (int j = 0; j < arr3.length; j++) {
                if(arr3[arr3.length-1]>0){
                    System.out.println("去掉最高位结果为:" + 0);
                }
            }
        }
    }
}
